# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=neo-regeorg
pkgver=v5.2.1.r9.g2b4498e
pkgrel=1
epoch=1
pkgdesc='Improved version of reGeorg, HTTP tunneling pivot tool'
arch=('any')
groups=('blackarch' 'blackarch-tunnel' 'blackarch-proxy')
url='https://github.com/L-codes/Neo-reGeorg'
license=('GPL3')
depends=('python' 'python-requests')
makedepends=('git')
source=("$pkgname::git+https://github.com/L-codes/Neo-reGeorg.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec /usr/share/$pkgname/neoreg.py "\$@"
EOF
  chmod 755 "$pkgdir/usr/bin/$pkgname"

  install -dm 755 "$pkgdir/usr/share/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" *.md

  cp -a --no-preserve=ownership * "$pkgdir/usr/share/$pkgname/"
}

